package com.J1ay.carsys.pojo;

import com.J1ay.carsys.utils.Common;
import lombok.Data;

import java.security.PrivateKey;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author J1ay
 * @Date 2021/6/2 18:31
 * @Description 租车人信息
 */

@Data
public class Bower {
    private String UId;
    private String Ecard;
    private String Bname;
    private String Bperm = "normal";
    private int empId;
    private String phone;
    private String Bpic;
    private Date createTime;
    private int status;

    @Override
    public String toString() {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
        String time=sdf.format(createTime);
        String permName;
        if(Bperm.equals("svip")){
            permName = "超级会员";
        }
        else if (Bperm.equals("vip")) {
            permName = "高级会员";
        }
        else {
            permName = "普通会员";
        }
        return Common.padString(UId,8) +
                Common.padString(Ecard,18) +
                Common.padString(Bname,5)+
                Common.padString(phone,12)+
                Common.padString(permName,5) +
                Common.padString(time, 18);
    }

    public String tocheck(){
        return
                Common.padString(UId,8) +
                Common.padString(Ecard,18) +
                Common.padString(Bname,5)+
                Common.padString(phone,12);
    }
}
